﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HtmlAgilityPack;
namespace NewsWcfWebService
{
    public class htmlParse
    {
        HtmlDocument htmlDoc;
        public HtmlDocument HtmlDoc
        {
            get { return htmlDoc; }
            set { htmlDoc = value; }
        }
        public htmlParse(string urlLink)
        {
            try
            {                
                HtmlAgilityPack.HtmlWeb feedWeb = new HtmlAgilityPack.HtmlWeb();
                htmlDoc = feedWeb.Load(urlLink);
            }
            catch (HtmlWebException htmlEx)
            {
                htmlDoc = null;
                throw htmlEx;
            }
        }
    }
}
